import {baseEffects, baseReducers, baseState} from "../../../../models/baseModel";

export default {
  namespace: 'dmap',

  state: {
    ...baseState,
    markerPositions: [],
  },

  reducers: {
    ...baseReducers
  },

  effects: {

    ...baseEffects,

    * init({payload}, {put}) {

      const markerPositions = [];
      for (let i = 0; i < 30; i++) {
        markerPositions.push({longitude: 80 + Math.random() * 40, latitude: 25 + Math.random() * 20})
      }

      yield put({
        type: 'initState',
        payload: {
          markerPositions
        }
      });
    },

  }

}

function getBaseUrl() {
  return "/device/ecg/";
}
